<?php
$xtpl = new XTemplate($inner_templates."home.intro.htm");
$xtpl_main->assign ("page_title", _LB_HOME);
$xtpl->assign ("base_url", $base_url);

$_SESSION['back_url'] = selfURL();
//-- get data from static pages
if($_GET['code']==""){
	$code="home_page";
}
else{
	$code=$_GET['code'];
}

$text = $DB->DBGetField('static_pages', "sp_code = '".$code."'", 'sp_text');
$xtpl->assign('txt',stripslashes($text));
$name = $DB->DBGetField('static_pages', "sp_code = '".$code."'", 'sp_name');
$xtpl->assign('name',stripslashes($name));

$rs = $DB->ZenDataList('service','','id_lang='.$_SESSION['ID_LANG'],'sp_pos ASC',"");
while($row = mysql_fetch_array($rs)){        
        $row['title']=stripslashes($row['sp_name']);
        $row['short_description']=stripslashes($row['sp_short_description']);
        if($row['sp_image'] == ""){
            $row['image'] = "unavail.gif";
        }
        else{
            $row['image'] = $row['sp_image'];
        }
        $row['id'] = $row['sp_id'];
        $row['class'] = "leftMenu";
        $row['url_html'] = RemoveSign($row['title']).".html";
        
        $xtpl->assign("list",$row);
        $xtpl->parse("center.listService");
}

$sql = "SELECT * FROM {$DP}banner WHERE status = 1 ORDER BY RAND() LIMIT 5";
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs)){
    $image = $row['image'];
    if($image != "" && file_exists($rootPath."upload/banner/".$image)){
        $row['image'] = $base_url."upload/banner/".$image;
        $xtpl->assign("banner",$row);
        $xtpl->parse("center.listBanner");
    }
}
//-- end
?>
